package com.srit.system.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * 获取数据库对象
 * 
 * @author guan
 * 
 */
public class DbLoadListener implements ServletContextListener {

	private ApplicationContext app;

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		app = WebApplicationContextUtils.getWebApplicationContext(sce
				.getServletContext()); // 获取spring上下文！
		
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		
	}

}
